

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/fluid.png">
  <link rel="icon" href="/img/fluid.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="John Doe">
  <meta name="keywords" content="">
  
    <meta name="description" content="@[toc] 以往课设记录 Web期末课程设计v1.0（一） | 大学生闲置物品交易系统 | 选择页面模板（附资源），使用 JQuery AJAX实现注册、登陆  运行环境 windows10 IDEA专业版 JDK8 HTML5、CSS、JavaScript JQuery Bootstrap5  1. 准备前端开发环境 1.1 JQuery 3.6.0JQuery官方地址 JQuery3.6.0">
<meta property="og:type" content="article">
<meta property="og:title" content="Web项目实战 _ 购物系统v1.0 _ 开发记录（二） _ 使用Bootstrap5各组件优化页面，使用AJAX请求实现用户修改信息功能">
<meta property="og:url" content="http://example.com/2021/12/20/Web%E9%A1%B9%E7%9B%AE%E5%AE%9E%E6%88%98%20_%20%E8%B4%AD%E7%89%A9%E7%B3%BB%E7%BB%9Fv1.0%20_%20%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95%EF%BC%88%E4%BA%8C%EF%BC%89%20_%20%E4%BD%BF%E7%94%A8Bootstrap5%E5%90%84%E7%BB%84%E4%BB%B6%E4%BC%98%E5%8C%96%E9%A1%B5%E9%9D%A2%EF%BC%8C%E4%BD%BF%E7%94%A8AJAX%E8%AF%B7%E6%B1%82%E5%AE%9E%E7%8E%B0%E7%94%A8%E6%88%B7%E4%BF%AE%E6%94%B9%E4%BF%A1%E6%81%AF%E5%8A%9F%E8%83%BD/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="@[toc] 以往课设记录 Web期末课程设计v1.0（一） | 大学生闲置物品交易系统 | 选择页面模板（附资源），使用 JQuery AJAX实现注册、登陆  运行环境 windows10 IDEA专业版 JDK8 HTML5、CSS、JavaScript JQuery Bootstrap5  1. 准备前端开发环境 1.1 JQuery 3.6.0JQuery官方地址 JQuery3.6.0">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img-blog.csdnimg.cn/6aca90ba7f7e42eda9ecce3ddb19f196.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/81ad22faa70542a79920db4cafd074b0.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/fe87367771ea4d0c9f2b694e69fc52dc.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/56a0f16eaf5047a8b65603d26433be5c.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/12804191a79b4af381a548a7bb9798e1.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/2c0ad036c7ed4c16bd239e736baec1a7.png#pic_center">
<meta property="og:image" content="https://img-blog.csdnimg.cn/f9027a907c3b4fde89b2072e761bf560.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/031f2e739079493c9dc5970eeab794ce.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/5798191a223e442bace202e8550d89f4.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/73da749567ca45039278d32eec7611a5.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/a7685b575dbb4510af4d5708f645ca67.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/2e015e26a6a646128c24d96c3bc7608e.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/fee0e60e86554bf3941aa018bc6fb938.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/6b09e3c0632c4c449309a7f840678d2f.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/7ba21050fcbf4395a60a74a62b4893c6.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/4e3ed4002ea1480da163eeb71a762df6.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/e61e3b8ad083459880844eaa285fb173.png">
<meta property="og:image" content="https://img-blog.csdnimg.cn/f6bd594ca80c4c219e425a672623cfa6.png">
<meta property="article:published_time" content="2021-12-20T03:58:57.000Z">
<meta property="article:modified_time" content="2022-08-22T15:50:16.561Z">
<meta property="article:author" content="John Doe">
<meta property="article:tag" content="JavaWeb">
<meta property="article:tag" content="项目实战:购物系统v1.0">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/6aca90ba7f7e42eda9ecce3ddb19f196.png#pic_center">
  
  
  
  <title>Web项目实战 _ 购物系统v1.0 _ 开发记录（二） _ 使用Bootstrap5各组件优化页面，使用AJAX请求实现用户修改信息功能 - Hexo</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.9.2","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 6.2.0"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>尤 Ni&#39;s Blog</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/default.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="Web项目实战 _ 购物系统v1.0 _ 开发记录（二） _ 使用Bootstrap5各组件优化页面，使用AJAX请求实现用户修改信息功能"></span>
          
        </div>

        
          
  <div class="mt-3">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-author" aria-hidden="true"></i>
        John Doe
      </span>
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2021-12-20 11:58" pubdate>
          2021年12月20日 中午
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          17k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          143 分钟
        
      </span>
    

    
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">Web项目实战 _ 购物系统v1.0 _ 开发记录（二） _ 使用Bootstrap5各组件优化页面，使用AJAX请求实现用户修改信息功能</h1>
            
              <p class="note note-info">
                
                  
                    本文最后更新于：1 小时前
                  
                
              </p>
            
            
              <div class="markdown-body">
                
                <p>@[toc]</p>
<h1 id="以往课设记录"><a href="#以往课设记录" class="headerlink" title="以往课设记录"></a>以往课设记录</h1><ul>
<li><a target="_blank" rel="noopener" href="https://blog.csdn.net/Unirithe/article/details/122028999">Web期末课程设计v1.0（一） | 大学生闲置物品交易系统 | 选择页面模板（附资源），使用 JQuery AJAX实现注册、登陆</a></li>
</ul>
<h1 id="运行环境"><a href="#运行环境" class="headerlink" title="运行环境"></a>运行环境</h1><ul>
<li>windows10</li>
<li>IDEA专业版</li>
<li>JDK8</li>
<li>HTML5、CSS、JavaScript</li>
<li>JQuery</li>
<li>Bootstrap5</li>
</ul>
<h1 id="1-准备前端开发环境"><a href="#1-准备前端开发环境" class="headerlink" title="1. 准备前端开发环境"></a>1. 准备前端开发环境</h1><hr>
<h2 id="1-1-JQuery-3-6-0"><a href="#1-1-JQuery-3-6-0" class="headerlink" title="1.1 JQuery 3.6.0"></a>1.1 JQuery 3.6.0</h2><p><a target="_blank" rel="noopener" href="https://jquery.com/">JQuery官方地址</a></p>
<p><a target="_blank" rel="noopener" href="https://code.jquery.com/jquery-3.6.0.min.js">JQuery3.6.0 代码地址</a></p>
<p>为了尽量加快网站加载的速度，则采用本地加载JS的方式。</p>
<p>故先在web项目的js文件夹里新建一个JQuery3.6.0文件，然后将上面代码地址里面的代码内容复制到新建的文件，最后在JSP或HTML代码页面使用 <code>link</code> 标签导入，导入的语句如下：</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;text/javascript&quot;</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;js/jquery-3.6.0-min.js&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span><br></code></pre></td></tr></table></figure>

<h2 id="1-2-Bootstrap5"><a href="#1-2-Bootstrap5" class="headerlink" title="1.2 Bootstrap5"></a>1.2 Bootstrap5</h2><hr>
<p><a target="_blank" rel="noopener" href="https://v5.bootcss.com/docs/getting-started/introduction/">Boostrap5 官方中文开发文档</a></p>
<p><a target="_blank" rel="noopener" href="https://objects.githubusercontent.com/github-production-release-asset-2e65be/2126244/558fbdfa-7ecc-41a8-a5b2-537d14af081b?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A/20211220/us-east-1/s3/aws4_request&X-Amz-Date=20211220T022130Z&X-Amz-Expires=300&X-Amz-Signature=a33c1d8395647c49f97b9c9e48f6e065ed55294f3e0aa967d6f65c5a195da3ef&X-Amz-SignedHeaders=host&actor_id=71979722&key_id=0&repo_id=2126244&response-content-disposition=attachment;%20filename=bootstrap-5.1.3-dist.zip&response-content-type=application/octet-stream">Bootstrap5官方下载地址</a></p>
<p>首先Bs5的安装，在官方下载好资源压缩包后，解压到项目的web根目录</p>
<p><img src="https://img-blog.csdnimg.cn/6aca90ba7f7e42eda9ecce3ddb19f196.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>接下来就在HTML页面中导入它的CSS和JS文件</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span><br>	<span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">&quot;stylesheet&quot;</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;text/css&quot;</span> <span class="hljs-attr">href</span>=<span class="hljs-string">&quot;bootstrap-5.1.3-dist/css/bootstrap.min.css&quot;</span>&gt;</span><br>	<span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;text/javascript&quot;</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;js/jquery-3.6.0-min.js&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span><br>	<span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;text/javascript&quot;</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;bootstrap-5.1.3-dist/js/bootstrap.min.js&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span><br>	<span class="hljs-comment">&lt;!--当前页面的其他JS文件--&gt;</span><br>	<span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;text/javascript&quot;</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;js/index.js&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span><br></code></pre></td></tr></table></figure>
<p><code>注：</code></p>
<ul>
<li>导入 Bootstrap框架的JS文件前一定要先导入 <code>JQuery</code>，而且版本不能低于其兼容的版本，这里笔者都采用了最新的版本，所以没有版本不兼容问题。</li>
<li>导入JS的代码放在head标签和放在其他位置会有差异，笔者暂未搞清楚这个差异的原因，所以目前放在head标签里面，没有出现问题</li>
</ul>
<h2 id="1-3-Bootstrap5-图标"><a href="#1-3-Bootstrap5-图标" class="headerlink" title="1.3 Bootstrap5 图标"></a>1.3 Bootstrap5 图标</h2><p><a target="_blank" rel="noopener" href="https://icons.bootcss.com/">bootstrap5 CSS 官方图标库地址</a></p>
<p><img src="https://img-blog.csdnimg.cn/81ad22faa70542a79920db4cafd074b0.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>若一个页面没有任何图标，只是单单的文字描述，那样就会比较单调，比如观察淘宝的首页</p>
<p><img src="https://img-blog.csdnimg.cn/fe87367771ea4d0c9f2b694e69fc52dc.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>从图中可以看中，淘宝的页面里用到了许多的图标，而且和对应的文字描述相呼应，这使得整个页面看起来更美观，清晰。</p>
<p>所以在页面中使用图标是很有必要的，不同于之前框架的下载，使用bootstrap5的图标库可以从网络导入一个CSS文件，由于笔者没有找到下载地址，所以直接用CDN方式代替</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">&quot;stylesheet&quot;</span> <span class="hljs-attr">href</span>=<span class="hljs-string">&quot;https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css&quot;</span>&gt;</span><br></code></pre></td></tr></table></figure>

<p>测试的代码</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;bi-alarm&quot;</span> <span class="hljs-attr">style</span>=<span class="hljs-string">&quot;font-size: 2rem; color: cornflowerblue;&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span><br></code></pre></td></tr></table></figure>

<p>当你想要使用它的某个图标时，先去官方 <a target="_blank" rel="noopener" href="https://icons.bootcss.com/">&gt;&gt;传送门&lt;&lt;</a> 直接查找想要的图标，然后点进图标的页面</p>
<p><img src="https://img-blog.csdnimg.cn/56a0f16eaf5047a8b65603d26433be5c.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>直接复制图标页面中的 <code>li</code> 标签代码即可</p>
<p>示例：在按钮组件中添加一个闹钟图标</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">button</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;bi bi-alarm-fill&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>闹钟按钮<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br></code></pre></td></tr></table></figure>
<p><img src="https://img-blog.csdnimg.cn/12804191a79b4af381a548a7bb9798e1.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>为了按钮更加美观，可以给按钮添加框架自带的一些按钮样式，比如:</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;btn btn-danger btn-sm&quot;</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;bi bi-alarm-fill&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span>闹钟按钮<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br></code></pre></td></tr></table></figure>
<p><img src="https://img-blog.csdnimg.cn/2c0ad036c7ed4c16bd239e736baec1a7.png#pic_center" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h1 id="2-优化页面、首页、用户信息页面"><a href="#2-优化页面、首页、用户信息页面" class="headerlink" title="2. 优化页面、首页、用户信息页面"></a>2. 优化页面、首页、用户信息页面</h1><hr>
<p>首先观察之前的模板<strong>首页</strong><br><img src="https://img-blog.csdnimg.cn/f9027a907c3b4fde89b2072e761bf560.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>特点：</p>
<ul>
<li>首部是网站的导航栏，左上方有网站LOGO、中间有一个搜索框和搜索按钮、右侧则可以跳转到购物车</li>
<li>页面中间，左侧是多高额商品的具体分类，中间是一些商品图片的轮播图，右侧是一些商品的推荐页面</li>
<li>页面下方，是不同商品类别以及若干商品的展示，展示包括商品名称、商品图片、商品价格。</li>
</ul>
<p>这里笔者少截了部分图，其实顶部还有关于用户信息的部分。</p>
<p>至此，分析了首页的结构，现对其进行调整，优化后的界面如下：</p>
<p><img src="https://img-blog.csdnimg.cn/031f2e739079493c9dc5970eeab794ce.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>首页的设计理念是，去掉滚动条，整个背景是一个轮播图，可以放一些网站介绍、商品相关的内容。</p>
<p>首部是一个透明度较低的导航栏，采用fixed布局，从而和轮播图重合。</p>
<p><strong>商品中心</strong></p>
<p>这里笔者还未具体设计，暂时将首部导航栏的透明度去掉，保证它在页面中是清楚可见的。<br><img src="https://img-blog.csdnimg.cn/5798191a223e442bace202e8550d89f4.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h2 id="2-1-轮播图"><a href="#2-1-轮播图" class="headerlink" title="2.1 轮播图"></a>2.1 轮播图</h2><p>轮播图直接采用框架的原生代码，然后修改的话只需要做出一部分调整。<br><a target="_blank" rel="noopener" href="https://v5.bootcss.com/docs/components/carousel/">Bootstrap5 轮播图 官方文档</a><br><img src="https://img-blog.csdnimg.cn/73da749567ca45039278d32eec7611a5.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>实现轮播图的原生Boostrap代码：</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;carouselExampleCaptions&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel slide&quot;</span> <span class="hljs-attr">data-bs-ride</span>=<span class="hljs-string">&quot;carousel&quot;</span>&gt;</span><br>  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-indicators&quot;</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#carouselExampleCaptions&quot;</span> <span class="hljs-attr">data-bs-slide-to</span>=<span class="hljs-string">&quot;0&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;active&quot;</span> <span class="hljs-attr">aria-current</span>=<span class="hljs-string">&quot;true&quot;</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">&quot;Slide 1&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#carouselExampleCaptions&quot;</span> <span class="hljs-attr">data-bs-slide-to</span>=<span class="hljs-string">&quot;1&quot;</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">&quot;Slide 2&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#carouselExampleCaptions&quot;</span> <span class="hljs-attr">data-bs-slide-to</span>=<span class="hljs-string">&quot;2&quot;</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">&quot;Slide 3&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-inner&quot;</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-item active&quot;</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;...&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;d-block w-100&quot;</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">&quot;...&quot;</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-caption d-none d-md-block&quot;</span>&gt;</span><br>        <span class="hljs-tag">&lt;<span class="hljs-name">h5</span>&gt;</span>First slide label<span class="hljs-tag">&lt;/<span class="hljs-name">h5</span>&gt;</span><br>        <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Some representative placeholder content for the first slide.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span><br>      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-item&quot;</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;...&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;d-block w-100&quot;</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">&quot;...&quot;</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-caption d-none d-md-block&quot;</span>&gt;</span><br>        <span class="hljs-tag">&lt;<span class="hljs-name">h5</span>&gt;</span>Second slide label<span class="hljs-tag">&lt;/<span class="hljs-name">h5</span>&gt;</span><br>        <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Some representative placeholder content for the second slide.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span><br>      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-item&quot;</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;...&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;d-block w-100&quot;</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">&quot;...&quot;</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-caption d-none d-md-block&quot;</span>&gt;</span><br>        <span class="hljs-tag">&lt;<span class="hljs-name">h5</span>&gt;</span>Third slide label<span class="hljs-tag">&lt;/<span class="hljs-name">h5</span>&gt;</span><br>        <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Some representative placeholder content for the third slide.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span><br>      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>  <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-control-prev&quot;</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#carouselExampleCaptions&quot;</span> <span class="hljs-attr">data-bs-slide</span>=<span class="hljs-string">&quot;prev&quot;</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-control-prev-icon&quot;</span> <span class="hljs-attr">aria-hidden</span>=<span class="hljs-string">&quot;true&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;visually-hidden&quot;</span>&gt;</span>Previous<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><br>  <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>  <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-control-next&quot;</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#carouselExampleCaptions&quot;</span> <span class="hljs-attr">data-bs-slide</span>=<span class="hljs-string">&quot;next&quot;</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-control-next-icon&quot;</span> <span class="hljs-attr">aria-hidden</span>=<span class="hljs-string">&quot;true&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;visually-hidden&quot;</span>&gt;</span>Next<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><br>  <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br></code></pre></td></tr></table></figure>

<p>看起来较复杂，其实使用的话只需要修改两个地方。</p>
<ul>
<li>修改表示轮播图的DIV组件 ID<br>之前的ID是 <code>carouselExampleCaptions</code> ，这里笔者将其修改为<code>carousel-index</code>但需要注意的是，不能仅仅修改div标签的id，因为在button标签里有一个<code>data-bs-target</code>属性指向了这个div组件，最好最直接的办法就是通过Ctrl+R进行全局替换，另外需注意的是，组件的ID不能重复。为了使轮播图显示在整个页面，最简单的方式就是给轮播图的div添加一个container-fluid类，这个是框架自带的一个容器类，可以实现100%宽度的布局</li>
<li>修改图片的资源位置</li>
</ul>
<p>最终实现轮播图的HTML代码如下：</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;carousel-index&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;col-md-12 carousel slide&quot;</span> <span class="hljs-attr">data-bs-ride</span>=<span class="hljs-string">&quot;carousel&quot;</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-indicators&quot;</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#carousel-index&quot;</span> <span class="hljs-attr">data-bs-slide-to</span>=<span class="hljs-string">&quot;0&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;active&quot;</span> <span class="hljs-attr">aria-current</span>=<span class="hljs-string">&quot;true&quot;</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">&quot;Slide 1&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#carousel-index&quot;</span> <span class="hljs-attr">data-bs-slide-to</span>=<span class="hljs-string">&quot;1&quot;</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">&quot;Slide 2&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#carousel-index&quot;</span> <span class="hljs-attr">data-bs-slide-to</span>=<span class="hljs-string">&quot;2&quot;</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">&quot;Slide 3&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>		<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-inner&quot;</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-item active&quot;</span>&gt;</span><br>				<span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;img/1.jpg&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;d-block w-100 h-100&quot;</span>&gt;</span><br>				<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-caption d-none d-md-block&quot;</span>&gt;</span><br>					<span class="hljs-tag">&lt;<span class="hljs-name">h5</span>&gt;</span>First slide label<span class="hljs-tag">&lt;/<span class="hljs-name">h5</span>&gt;</span><br>					<span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Some representative placeholder content for the first slide.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span><br>				<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>			<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-item&quot;</span>&gt;</span><br>				<span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;img/2.jpg&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;d-block w-100 h-100&quot;</span> &gt;</span><br>				<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-caption d-none d-md-block&quot;</span>&gt;</span><br>					<span class="hljs-tag">&lt;<span class="hljs-name">h5</span>&gt;</span>Second slide label<span class="hljs-tag">&lt;/<span class="hljs-name">h5</span>&gt;</span><br>					<span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Some representative placeholder content for the second slide.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span><br>				<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>			<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-item&quot;</span>&gt;</span><br>				<span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;img/3.jpg&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;d-block w-100 h-100&quot;</span>&gt;</span><br>				<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-caption d-none d-md-block&quot;</span>&gt;</span><br>					<span class="hljs-tag">&lt;<span class="hljs-name">h5</span>&gt;</span>Third slide label<span class="hljs-tag">&lt;/<span class="hljs-name">h5</span>&gt;</span><br>					<span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Some representative placeholder content for the third slide.<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span><br>				<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>			<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>		<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-control-prev&quot;</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#carousel-index&quot;</span> <span class="hljs-attr">data-bs-slide</span>=<span class="hljs-string">&quot;prev&quot;</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-control-prev-icon&quot;</span> <span class="hljs-attr">aria-hidden</span>=<span class="hljs-string">&quot;true&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;visually-hidden&quot;</span>&gt;</span>Previous<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><br>		<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-control-next&quot;</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#carousel-index&quot;</span> <span class="hljs-attr">data-bs-slide</span>=<span class="hljs-string">&quot;next&quot;</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;carousel-control-next-icon&quot;</span> <span class="hljs-attr">aria-hidden</span>=<span class="hljs-string">&quot;true&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;visually-hidden&quot;</span>&gt;</span>Next<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><br>		<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>	<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br></code></pre></td></tr></table></figure>

<p>具体的图片描述内容还没修改，后期在进行调整即可。</p>
<h2 id="2-2-个人信息页面"><a href="#2-2-个人信息页面" class="headerlink" title="2.2 个人信息页面"></a>2.2 个人信息页面</h2><p>参考模板的页面：<br><img src="https://img-blog.csdnimg.cn/a7685b575dbb4510af4d5708f645ca67.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>修改后的页面效果：<br><img src="https://img-blog.csdnimg.cn/2e015e26a6a646128c24d96c3bc7608e.png" srcset="/img/loading.gif" lazyload><br>修改联系电话：</p>
<p><img src="https://img-blog.csdnimg.cn/fee0e60e86554bf3941aa018bc6fb938.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<h3 id="2-2-1-左侧信息响应式选择的组件-List-Group"><a href="#2-2-1-左侧信息响应式选择的组件-List-Group" class="headerlink" title="2.2.1 左侧信息响应式选择的组件 List Group"></a>2.2.1 左侧信息响应式选择的组件 List Group</h3><p><a target="_blank" rel="noopener" href="https://v5.bootcss.com/docs/components/list-group/">Bootstrap5 List Group 官方文档</a><br>框架的这部分代码可以实现页面内容的切换，同时有一个渐变的效果，笔者用其作为用户信息页面，左侧模块选择的一个组件，在官方代码基础上把跳转的div标签修改为iframe标签，指向其他的页面，则简单的实现了个人信息页面不同页面跳转。<br><img src="https://img-blog.csdnimg.cn/6b09e3c0632c4c449309a7f840678d2f.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p><strong>Bootstrap5 ListGroup 官方代码</strong></p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;row&quot;</span>&gt;</span><br>  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;col-4&quot;</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;list-group&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;list-tab&quot;</span> <span class="hljs-attr">role</span>=<span class="hljs-string">&quot;tablist&quot;</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;list-group-item list-group-item-action active&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;list-home-list&quot;</span> <span class="hljs-attr">data-bs-toggle</span>=<span class="hljs-string">&quot;list&quot;</span> <span class="hljs-attr">href</span>=<span class="hljs-string">&quot;#list-home&quot;</span> <span class="hljs-attr">role</span>=<span class="hljs-string">&quot;tab&quot;</span> <span class="hljs-attr">aria-controls</span>=<span class="hljs-string">&quot;list-home&quot;</span>&gt;</span>Home<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;list-group-item list-group-item-action&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;list-profile-list&quot;</span> <span class="hljs-attr">data-bs-toggle</span>=<span class="hljs-string">&quot;list&quot;</span> <span class="hljs-attr">href</span>=<span class="hljs-string">&quot;#list-profile&quot;</span> <span class="hljs-attr">role</span>=<span class="hljs-string">&quot;tab&quot;</span> <span class="hljs-attr">aria-controls</span>=<span class="hljs-string">&quot;list-profile&quot;</span>&gt;</span>Profile<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;list-group-item list-group-item-action&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;list-messages-list&quot;</span> <span class="hljs-attr">data-bs-toggle</span>=<span class="hljs-string">&quot;list&quot;</span> <span class="hljs-attr">href</span>=<span class="hljs-string">&quot;#list-messages&quot;</span> <span class="hljs-attr">role</span>=<span class="hljs-string">&quot;tab&quot;</span> <span class="hljs-attr">aria-controls</span>=<span class="hljs-string">&quot;list-messages&quot;</span>&gt;</span>Messages<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;list-group-item list-group-item-action&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;list-settings-list&quot;</span> <span class="hljs-attr">data-bs-toggle</span>=<span class="hljs-string">&quot;list&quot;</span> <span class="hljs-attr">href</span>=<span class="hljs-string">&quot;#list-settings&quot;</span> <span class="hljs-attr">role</span>=<span class="hljs-string">&quot;tab&quot;</span> <span class="hljs-attr">aria-controls</span>=<span class="hljs-string">&quot;list-settings&quot;</span>&gt;</span>Settings<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span><br>    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;col-8&quot;</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;tab-content&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;nav-tabContent&quot;</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;tab-pane fade show active&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;list-home&quot;</span> <span class="hljs-attr">role</span>=<span class="hljs-string">&quot;tabpanel&quot;</span> <span class="hljs-attr">aria-labelledby</span>=<span class="hljs-string">&quot;list-home-list&quot;</span>&gt;</span>...<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;tab-pane fade&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;list-profile&quot;</span> <span class="hljs-attr">role</span>=<span class="hljs-string">&quot;tabpanel&quot;</span> <span class="hljs-attr">aria-labelledby</span>=<span class="hljs-string">&quot;list-profile-list&quot;</span>&gt;</span>...<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;tab-pane fade&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;list-messages&quot;</span> <span class="hljs-attr">role</span>=<span class="hljs-string">&quot;tabpanel&quot;</span> <span class="hljs-attr">aria-labelledby</span>=<span class="hljs-string">&quot;list-messages-list&quot;</span>&gt;</span>...<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;tab-pane fade&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;list-settings&quot;</span> <span class="hljs-attr">role</span>=<span class="hljs-string">&quot;tabpanel&quot;</span> <span class="hljs-attr">aria-labelledby</span>=<span class="hljs-string">&quot;list-settings-list&quot;</span>&gt;</span>...<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br></code></pre></td></tr></table></figure>

<p>应用后的HTML代码:</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;col-md-2 nav flex-column nav-pills me-3&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;v-pills-tab&quot;</span> <span class="hljs-attr">role</span>=<span class="hljs-string">&quot;tablist&quot;</span> <span class="hljs-attr">aria-orientation</span>=<span class="hljs-string">&quot;vertical&quot;</span>&gt;</span><br>	<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;nav-link active&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;bt-left-card-info&quot;</span> <span class="hljs-attr">data-bs-toggle</span>=<span class="hljs-string">&quot;pill&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#iframe_info&quot;</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">role</span>=<span class="hljs-string">&quot;tab&quot;</span> <span class="hljs-attr">aria-controls</span>=<span class="hljs-string">&quot;iframe_info&quot;</span> <span class="hljs-attr">aria-selected</span>=<span class="hljs-string">&quot;true&quot;</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;bi bi-person-circle&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span><br>		个人信息<br>	<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>	<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;nav-link&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;bt-left-card-buy&quot;</span> <span class="hljs-attr">data-bs-toggle</span>=<span class="hljs-string">&quot;pill&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#iframe_buy_record&quot;</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">role</span>=<span class="hljs-string">&quot;tab&quot;</span> <span class="hljs-attr">aria-controls</span>=<span class="hljs-string">&quot;iframe_buy_record&quot;</span> <span class="hljs-attr">aria-selected</span>=<span class="hljs-string">&quot;false&quot;</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;bi bi-cart-fill&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span><br>		购买记录<br>	<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>	<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;nav-link&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;v-pills-profile-tab&quot;</span> <span class="hljs-attr">data-bs-toggle</span>=<span class="hljs-string">&quot;pill&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#v-pills-profile&quot;</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">role</span>=<span class="hljs-string">&quot;tab&quot;</span> <span class="hljs-attr">aria-controls</span>=<span class="hljs-string">&quot;v-pills-profile&quot;</span> <span class="hljs-attr">aria-selected</span>=<span class="hljs-string">&quot;false&quot;</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;bi bi-shop&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span><br>		发布的商品<br>	<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>	<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;nav-link&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;bt-left-card-address&quot;</span> <span class="hljs-attr">data-bs-toggle</span>=<span class="hljs-string">&quot;pill&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#v-pills-messages&quot;</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">role</span>=<span class="hljs-string">&quot;tab&quot;</span> <span class="hljs-attr">aria-controls</span>=<span class="hljs-string">&quot;v-pills-messages&quot;</span> <span class="hljs-attr">aria-selected</span>=<span class="hljs-string">&quot;false&quot;</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;bi bi-geo-alt&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span><br>		收货地址<br>	<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br></code></pre></td></tr></table></figure>
<h3 id="2-2-2-在弹窗中修改信息-Model"><a href="#2-2-2-在弹窗中修改信息-Model" class="headerlink" title="2.2.2 在弹窗中修改信息  Model"></a>2.2.2 在弹窗中修改信息  Model</h3><p>框架的Model组件可以弹出一个窗口，笔者思路是在这样的窗口进行信息修改。</p>
<p><a target="_blank" rel="noopener" href="https://v5.bootcss.com/docs/components/modal/#varying-modal-content">Bootstrap5 Model 官方文档</a><br><img src="https://img-blog.csdnimg.cn/7ba21050fcbf4395a60a74a62b4893c6.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>Bootstrap5 原生代码</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;btn btn-primary&quot;</span> <span class="hljs-attr">data-bs-toggle</span>=<span class="hljs-string">&quot;modal&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#exampleModal&quot;</span> <span class="hljs-attr">data-bs-whatever</span>=<span class="hljs-string">&quot;@mdo&quot;</span>&gt;</span>Open modal for @mdo<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;btn btn-primary&quot;</span> <span class="hljs-attr">data-bs-toggle</span>=<span class="hljs-string">&quot;modal&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#exampleModal&quot;</span> <span class="hljs-attr">data-bs-whatever</span>=<span class="hljs-string">&quot;@fat&quot;</span>&gt;</span>Open modal for @fat<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;btn btn-primary&quot;</span> <span class="hljs-attr">data-bs-toggle</span>=<span class="hljs-string">&quot;modal&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#exampleModal&quot;</span> <span class="hljs-attr">data-bs-whatever</span>=<span class="hljs-string">&quot;@getbootstrap&quot;</span>&gt;</span>Open modal for @getbootstrap<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br><br><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;modal fade&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;exampleModal&quot;</span> <span class="hljs-attr">tabindex</span>=<span class="hljs-string">&quot;-1&quot;</span> <span class="hljs-attr">aria-labelledby</span>=<span class="hljs-string">&quot;exampleModalLabel&quot;</span> <span class="hljs-attr">aria-hidden</span>=<span class="hljs-string">&quot;true&quot;</span>&gt;</span><br>  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;modal-dialog&quot;</span>&gt;</span><br>    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;modal-content&quot;</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;modal-header&quot;</span>&gt;</span><br>        <span class="hljs-tag">&lt;<span class="hljs-name">h5</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;modal-title&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;exampleModalLabel&quot;</span>&gt;</span>New message<span class="hljs-tag">&lt;/<span class="hljs-name">h5</span>&gt;</span><br>        <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;btn-close&quot;</span> <span class="hljs-attr">data-bs-dismiss</span>=<span class="hljs-string">&quot;modal&quot;</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">&quot;Close&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;modal-body&quot;</span>&gt;</span><br>        <span class="hljs-tag">&lt;<span class="hljs-name">form</span>&gt;</span><br>          <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;mb-3&quot;</span>&gt;</span><br>            <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">&quot;recipient-name&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;col-form-label&quot;</span>&gt;</span>Recipient:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span><br>            <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;text&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;form-control&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;recipient-name&quot;</span>&gt;</span><br>          <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>          <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;mb-3&quot;</span>&gt;</span><br>            <span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">&quot;message-text&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;col-form-label&quot;</span>&gt;</span>Message:<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span><br>            <span class="hljs-tag">&lt;<span class="hljs-name">textarea</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;form-control&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;message-text&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">textarea</span>&gt;</span><br>          <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>        <span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span><br>      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;modal-footer&quot;</span>&gt;</span><br>        <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;btn btn-secondary&quot;</span> <span class="hljs-attr">data-bs-dismiss</span>=<span class="hljs-string">&quot;modal&quot;</span>&gt;</span>Close<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>        <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;btn btn-primary&quot;</span>&gt;</span>Send message<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br></code></pre></td></tr></table></figure>

<p>应用后的HTML代码</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br></pre></td><td class="code"><pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;btn btn-warning btn-sm &quot;</span> <span class="hljs-attr">data-bs-toggle</span>=<span class="hljs-string">&quot;modal&quot;</span> <span class="hljs-attr">data-bs-target</span>=<span class="hljs-string">&quot;#exampleModal&quot;</span> <span class="hljs-attr">data-bs-whatever</span>=<span class="hljs-string">&quot;@mdo&quot;</span> <span class="hljs-attr">style</span>=<span class="hljs-string">&quot;width: 100%&quot;</span>&gt;</span>修改<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br><br><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;modal fade&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;exampleModal&quot;</span> <span class="hljs-attr">tabindex</span>=<span class="hljs-string">&quot;-1&quot;</span> <span class="hljs-attr">aria-labelledby</span>=<span class="hljs-string">&quot;exampleModalLabel&quot;</span> <span class="hljs-attr">aria-hidden</span>=<span class="hljs-string">&quot;true&quot;</span>&gt;</span><br>	<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;modal-dialog&quot;</span>&gt;</span><br>		<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;modal-content&quot;</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;modal-header&quot;</span>&gt;</span><br>				<span class="hljs-tag">&lt;<span class="hljs-name">h5</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;modal-title&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;exampleModalLabel&quot;</span>&gt;</span><br>					<span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;bi bi-pencil-square&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span><br>					修改个人信息<br>				<span class="hljs-tag">&lt;/<span class="hljs-name">h5</span>&gt;</span><br>				<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;btn-close&quot;</span> <span class="hljs-attr">data-bs-dismiss</span>=<span class="hljs-string">&quot;modal&quot;</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">&quot;Close&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>			<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;modal-body&quot;</span>&gt;</span><br>				<span class="hljs-tag">&lt;<span class="hljs-name">form</span>&gt;</span><br>					<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;mb-3&quot;</span>&gt;</span><br>						<span class="hljs-tag">&lt;<span class="hljs-name">h5</span>&gt;</span><br>							<span class="hljs-tag">&lt;<span class="hljs-name">i</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;bi bi-telephone&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">i</span>&gt;</span><br>							新的联系电话<br>						<span class="hljs-tag">&lt;/<span class="hljs-name">h5</span>&gt;</span><br>						<span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;text&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;form-control input-phone&quot;</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;recipient-name&quot;</span>&gt;</span><br>						<span class="hljs-tag">&lt;<span class="hljs-name">span</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><br>					<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>				<span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span><br>			<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>			<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;modal-footer&quot;</span>&gt;</span><br>				<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;btn btn-secondary&quot;</span> <span class="hljs-attr">data-bs-dismiss</span>=<span class="hljs-string">&quot;modal&quot;</span>&gt;</span>取消<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>				<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;button&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;btn btn-primary bt-mdify-ok&quot;</span>&gt;</span>确认修改<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br>			<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>		<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br>	<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br></code></pre></td></tr></table></figure>

<h2 id="2-3-订单页面-可伸缩订单信息-Accordion"><a href="#2-3-订单页面-可伸缩订单信息-Accordion" class="headerlink" title="2.3 订单页面 可伸缩订单信息 Accordion"></a>2.3 订单页面 可伸缩订单信息 Accordion</h2><p>原先的模板页面</p>
<p><img src="https://img-blog.csdnimg.cn/4e3ed4002ea1480da163eeb71a762df6.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>修改后的页面<br><img src="https://img-blog.csdnimg.cn/e61e3b8ad083459880844eaa285fb173.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"><br>这里采用了Bootstrap5框架的Accordion 组件<br><a target="_blank" rel="noopener" href="https://v5.bootcss.com/docs/components/accordion/">Bootstrap5 accordion 官方文档</a><br><img src="https://img-blog.csdnimg.cn/f6bd594ca80c4c219e425a672623cfa6.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>
<p>由于一个订单可能包含多个商品，然后商品还需要有图片，所以若直接在页面显示一个订单的所有消息，最终的效果可能不太好，这里则采用收缩的形式，收起前会展示订单的时间、单号、状态，展开后会展示订单详情，目前的数据是模拟的，还没有进行数据库的交互。</p>
<h1 id="3-实现用户信息修改"><a href="#3-实现用户信息修改" class="headerlink" title="3. 实现用户信息修改"></a>3. 实现用户信息修改</h1><h2 id="3-1-dao层"><a href="#3-1-dao层" class="headerlink" title="3.1 dao层"></a>3.1 dao层</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-meta">@Override</span><br><span class="hljs-keyword">public</span> <span class="hljs-type">boolean</span> <span class="hljs-title function_">updateUSer</span><span class="hljs-params">(User user)</span> &#123;<br>    <span class="hljs-type">Connection</span> <span class="hljs-variable">connection</span> <span class="hljs-operator">=</span> DruidUtil.getConnection();<br>    <span class="hljs-type">String</span> <span class="hljs-variable">sql</span> <span class="hljs-operator">=</span> <span class="hljs-string">&quot;update user set phone = ? where id = ?&quot;</span>;<br>    <span class="hljs-type">int</span> <span class="hljs-variable">result</span> <span class="hljs-operator">=</span> <span class="hljs-number">0</span>;<br>    <span class="hljs-keyword">try</span>&#123;<br>        <span class="hljs-type">PreparedStatement</span> <span class="hljs-variable">pstmt</span> <span class="hljs-operator">=</span> connection.prepareStatement(sql);<br>        pstmt.setString(<span class="hljs-number">1</span>, user.getPhone());<br>        pstmt.setInt(<span class="hljs-number">2</span>, user.getId());<br>        result = pstmt.executeUpdate();<br>        DruidUtil.release(connection, pstmt, <span class="hljs-literal">null</span>);<br>    &#125; <span class="hljs-keyword">catch</span> (SQLException throwables) &#123;<br>        throwables.printStackTrace();<br>    &#125;<br>    <span class="hljs-keyword">return</span> result == <span class="hljs-number">1</span>;<br>&#125;<br></code></pre></td></tr></table></figure>

<h2 id="3-2-Servlet"><a href="#3-2-Servlet" class="headerlink" title="3.2 Servlet"></a>3.2 Servlet</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-meta">@WebServlet(name = &quot;UserUpdateServlet&quot;, urlPatterns = &quot;/toUpdate&quot;)</span><br><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">UserUpdateServlet</span> <span class="hljs-keyword">extends</span> <span class="hljs-title class_">HttpServlet</span> &#123;<br>    <span class="hljs-meta">@Override</span><br>    <span class="hljs-keyword">protected</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">doGet</span><span class="hljs-params">(HttpServletRequest req, HttpServletResponse resp)</span> <span class="hljs-keyword">throws</span> ServletException, IOException &#123;<br>        resp.getWriter().write(<span class="hljs-string">&quot;不支持GET方式的请求&quot;</span>);<br>    &#125;<br>    <span class="hljs-meta">@Override</span><br>    <span class="hljs-keyword">protected</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">doPost</span><span class="hljs-params">(HttpServletRequest req, HttpServletResponse resp)</span> <span class="hljs-keyword">throws</span> ServletException, IOException &#123;<br>        <span class="hljs-type">HttpSession</span> <span class="hljs-variable">session</span> <span class="hljs-operator">=</span> req.getSession();<br>        <span class="hljs-type">String</span> <span class="hljs-variable">phone</span> <span class="hljs-operator">=</span> req.getParameter(<span class="hljs-string">&quot;phone&quot;</span>);<br>        <span class="hljs-type">User</span> <span class="hljs-variable">user</span> <span class="hljs-operator">=</span> ((User)session.getAttribute(<span class="hljs-string">&quot;userInfo&quot;</span>)).clone();<br>        user.setPhone(phone);<br>        <span class="hljs-type">boolean</span> <span class="hljs-variable">flag</span> <span class="hljs-operator">=</span> Service.user.updateUser(user);<br>        <span class="hljs-keyword">if</span>(flag) session.setAttribute(<span class="hljs-string">&quot;userInfo&quot;</span>, user);<br>        resp.getWriter().write(flag ? <span class="hljs-string">&quot;true&quot;</span> : <span class="hljs-string">&quot;false&quot;</span>);<br>    &#125;<br>&#125;<br></code></pre></td></tr></table></figure>
<h2 id="3-3-AJAX"><a href="#3-3-AJAX" class="headerlink" title="3.3 AJAX"></a>3.3 AJAX</h2><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><code class="hljs javascript">$(<span class="hljs-string">&quot;.bt-mdify-ok&quot;</span>).<span class="hljs-title function_">click</span>(<span class="hljs-keyword">function</span> (<span class="hljs-params"></span>)&#123;<br>    <span class="hljs-keyword">if</span>(( $(<span class="hljs-string">&quot;.input-phone&quot;</span>).<span class="hljs-title function_">val</span>()).<span class="hljs-property">length</span> != <span class="hljs-number">11</span>) &#123;<br>        <span class="hljs-title function_">alert</span>(<span class="hljs-string">&#x27;请输入11位的联系电话&#x27;</span>)<br>        <span class="hljs-keyword">return</span> ;<br>    &#125; <span class="hljs-keyword">else</span>&#123;<br>        $.<span class="hljs-title function_">ajax</span>(&#123;<br>            <span class="hljs-attr">type</span>: <span class="hljs-string">&#x27;POST&#x27;</span>,<br>            <span class="hljs-attr">url</span>: <span class="hljs-string">&#x27;toUpdate?phone=&#x27;</span> + $(<span class="hljs-string">&quot;.input-phone&quot;</span>).<span class="hljs-title function_">val</span>(),<br>            <span class="hljs-attr">async</span>: <span class="hljs-literal">false</span>,<br>            <span class="hljs-attr">error</span>: <span class="hljs-keyword">function</span> (<span class="hljs-params">data</span>)&#123;<br>                <span class="hljs-title function_">alert</span>(<span class="hljs-string">&#x27;访问servlet失败 &#x27;</span> + data)<br>            &#125;,<br>            <span class="hljs-attr">success</span>: <span class="hljs-keyword">function</span> (<span class="hljs-params">data</span>)&#123;<br>                <span class="hljs-keyword">if</span>(data == <span class="hljs-string">&quot;true&quot;</span>)&#123;<br>                    <span class="hljs-title function_">alert</span>(<span class="hljs-string">&#x27;修改成功!&#x27;</span>)<br>                &#125; <span class="hljs-keyword">else</span>&#123;<br>                    <span class="hljs-title function_">alert</span>(<span class="hljs-string">&#x27;修改失败.&#x27;</span>)<br>                &#125;<br>                <span class="hljs-variable language_">window</span>.<span class="hljs-property">location</span>.<span class="hljs-property">href</span>=<span class="hljs-string">&#x27;/card_user_info.jsp&#x27;</span><br>            &#125;<br>        &#125;)<br>    &#125;<br>&#125;);<br></code></pre></td></tr></table></figure>


<h1 id="4-总结"><a href="#4-总结" class="headerlink" title="4. 总结"></a>4. 总结</h1><hr>
<p>这是笔者昨天一整天的记录，工作量比较大，光是总结都花了一两个小时，因为bootstrap5框架能使用的组件比较多，如果不进行记录，可能很快就会忘记，比如用到的一些设计思路，既有借鉴其他网站，也有突发奇想的时候。</p>
<p>经过本次设计，购物网首页大致完成了，只需要再找几张图片，并撰写相关的描述就可以了。</p>
<p>订单查询的话需要进行JDBC操作，再此之前得完成数据表的设计，以及插入一些测试的数据。</p>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E9%A1%B9%E7%9B%AE%E5%AE%9E%E6%88%98-%E8%B4%AD%E7%89%A9%E7%B3%BB%E7%BB%9Fv1-0/" class="category-chain-item">项目实战:购物系统v1.0</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/JavaWeb/">#JavaWeb</a>
      
        <a href="/tags/%E9%A1%B9%E7%9B%AE%E5%AE%9E%E6%88%98-%E8%B4%AD%E7%89%A9%E7%B3%BB%E7%BB%9Fv1-0/">#项目实战:购物系统v1.0</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>Web项目实战 _ 购物系统v1.0 _ 开发记录（二） _ 使用Bootstrap5各组件优化页面，使用AJAX请求实现用户修改信息功能</div>
      <div>http://example.com/2021/12/20/Web项目实战 _ 购物系统v1.0 _ 开发记录（二） _ 使用Bootstrap5各组件优化页面，使用AJAX请求实现用户修改信息功能/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>John Doe</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2021年12月20日</div>
        </div>
      
      
      <div class="license-meta-item">
        <div>许可协议</div>
        <div>
          
            
            
              <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
              <span class="hint--top hint--rounded" aria-label="BY - 署名">
                <i class="iconfont icon-by"></i>
              </span>
              </a>
            
          
        </div>
      </div>
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2021/12/21/Web%E9%A1%B9%E7%9B%AE%E5%AE%9E%E6%88%98%20_%20%E8%B4%AD%E7%89%A9%E7%B3%BB%E7%BB%9Fv1.0%20_%20%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95%EF%BC%88%E4%B8%89%EF%BC%89%20_%20%E5%9F%BA%E4%BA%8EBootstrap%E8%AE%BE%E8%AE%A1%E5%95%86%E5%93%81%E9%A1%B5%E9%9D%A2%E3%80%81%E4%BD%BF%E7%94%A8JQuery%E5%AE%9E%E7%8E%B0%E4%B8%8A%E4%BC%A0%E6%96%87%E4%BB%B6%E5%B9%B6%E6%98%BE%E7%A4%BA%E5%88%B0%E5%9B%BE%E7%89%87%E7%BB%84%E4%BB%B6%E3%80%81%E4%BD%BF%E7%94%A8JSTL%E6%A0%87%E7%AD%BE%E6%98%BE%E7%A4%BA%E6%95%B0%E6%8D%AE%E5%BA%93%E7%9A%84%E5%86%85%E5%AE%B9%E5%88%B0%E6%97%A0%E5%BA%8F%E5%88%97%E8%A1%A8/" title="Web项目实战 _ 购物系统v1.0 _ 开发记录（三） _ 基于Bootstrap设计商品页面、使用JQuery实现上传文件并显示到图片组件、使用JSTL标签显示数据库的内容到无序列表">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">Web项目实战 _ 购物系统v1.0 _ 开发记录（三） _ 基于Bootstrap设计商品页面、使用JQuery实现上传文件并显示到图片组件、使用JSTL标签显示数据库的内容到无序列表</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2021/12/19/Web%E9%A1%B9%E7%9B%AE%E5%AE%9E%E6%88%98%20_%20%E8%B4%AD%E7%89%A9%E7%B3%BB%E7%BB%9Fv1.0%20_%20%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95%EF%BC%88%E4%B8%80%EF%BC%89%20_%20%E5%A4%A7%E5%AD%A6%E7%94%9F%E9%97%B2%E7%BD%AE%E7%89%A9%E5%93%81%E4%BA%A4%E6%98%93%E7%B3%BB%E7%BB%9F%20_%20%E9%80%89%E6%8B%A9%E9%A1%B5%E9%9D%A2%E6%A8%A1%E6%9D%BF%EF%BC%88%E9%99%84%E8%B5%84%E6%BA%90%EF%BC%89%EF%BC%8C%E4%BD%BF%E7%94%A8%20JQuery%20AJAX%E5%AE%9E%E7%8E%B0%E6%B3%A8%E5%86%8C%E3%80%81%E7%99%BB%E9%99%86/" title="Web项目实战 _ 购物系统v1.0 _ 开发记录（一） _ 大学生闲置物品交易系统 _ 选择页面模板（附资源），使用 JQuery AJAX实现注册、登陆">
                        <span class="hidden-mobile">Web项目实战 _ 购物系统v1.0 _ 开发记录（一） _ 大学生闲置物品交易系统 _ 选择页面模板（附资源），使用 JQuery AJAX实现注册、登陆</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      headingSelector : CONFIG.toc.headingSelector || 'h1,h2,h3,h4,h5,h6',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      collapseDepth   : CONFIG.toc.collapseDepth || 0,
      scrollSmooth    : true,
      headingsOffset  : -boardTop
    });
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.10/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
